// 导入HTTP请求工具
import request from '@/app/utils/request';
// 统一定义后台接口地址
const url = {
    //文章类接口
    article: {
        //获取首页推荐
        getIndex: "/article/getIndexArticle",
        //获取技术专栏或程序人生
        getTechnicalOrLife: "/article/getTechnicalOrLife",
        //获取归档信息
        getTimeline: "/article/getTimeline",
        //搜素
        getSearch: "/article/search",
        //获取一个文章
        getOne: "/article/getOne",
    },
    //标签类接口
    tag: {
        //获取所有标签
        getAll: "/tag/getAll",
    },
    //菜单类接口
    menu: {
        //获取所有菜单项
        getAll: "/menu/getAll",
    },
    //公告类接口
    notice: {
        //获取所有正常公布公告
        getAll: "/notice/getAll",
    }
}
//对外导出操作方法
export default {
    article: {
        getIndex(param){
            return request.get(url.article.getIndex,param);
        },
        getTechnicalOrLife(param){
            return request.get(url.article.getTechnicalOrLife,param);
        },
        getTimeline(){
            return request.get(url.article.getTimeline);
        },
        getSearch(param){
            return request.get(url.article.getSearch,param);
        },
        getOne(param){
            return request.get(url.article.getOne,param);
        }
    },
    tag: {
        getAll(){
            return request.get(url.tag.getAll);
        }
    },
    menu: {
        getAll(){
            return request.get(url.menu.getAll);
        }
    },
    notice: {
        getAll(){
            return request.get(url.notice.getAll);
        }
    }
    
}